<?php
/**
  * @name index
 * @package public
 * @author Truonghm
 * @version $1.0
 * @license http://officex.vn/license
 * @copyright officex.
 * 30/10/2010
 */

if (true === version_compare(phpversion(), '5.2.4', '<')) {
	exit('Boot failure ! (102)');
}

defined('OFX_ROOT_DIR')
    || define('OFX_ROOT_DIR', realpath(dirname(dirname(__FILE__))));
    
defined('OFX_APP_DIR')
    || define('OFX_APP_DIR', OFX_ROOT_DIR . '/application');
    
defined('APPLICATION_ENV')
    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'development'));

define('OFX_IMAGES','/images');
define('OFX_ICONS','/images/icons');
   
set_include_path(implode(PATH_SEPARATOR, array(
            OFX_ROOT_DIR . '/library',
            OFX_ROOT_DIR . '/application/modules',
            get_include_path(),
            )
));

$configFile = OFX_APP_DIR . '/configs/Application.ini';
require_once 'Zend/Application.php';

$application = new Zend_Application(
    APPLICATION_ENV,
    $configFile
    );

 try {     
     $application->getBootstrap()->bootstrap('FrontController');
     $application->getBootstrap()->bootstrap('Router');
     $application->bootstrap()->run();
 } catch (Exception $exp) {
     
     echo $exp;
     
     //.......
     
 }  
    
    
    
    
    
    